package com.hxzy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hxzy.dto.SysDictDataSearchDTO;
import com.hxzy.entity.SysDictData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface SysDictDataMapper extends BaseMapper<SysDictData> {

    /**
     * 根据类型查询值
     * @param dictType
     * @return
     */
    @Select(value = "select DICT_LABEL,DICT_VALUE from SYS_DICT_DATA where DICT_TYPE=#{dictType} and STATUS='0' order by DICT_SORT ")
    List<SysDictData> findByDictType(String dictType);

    /**
     * 分页查询
     * @param page
     * @param dto
     * @return
     */
    IPage<SysDictData> findByDictTypePage(IPage page, @Param(value = "dto") SysDictDataSearchDTO dto);
}